<%@ page import="java.util.List" %>
<%@ page import="com.scau.ums.model.Repairreport" %>
<%@ page import="com.scau.ums.model.User" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/7/29
  Time: 10:05
  To change this template use File | Settings | File Templates.

  modified by xfy when 2019年8月14日15:09:04
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html class="no-js" lang="en">
<script src="js/jquery-3.3.1min.js"></script>
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>维修工功能界面</title>
    <meta name="robots" content="noindex, follow" />
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- Favicon -->
    <link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">

    <!-- CSS
	============================================ -->
    <!-- google fonts -->
    <link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,600,700,800,900%7CPoppins:300,400,500,600,700,800,900" rel="stylesheet">
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="css/bootstrapmin.css">
    <!-- Font-awesome CSS -->
    <link rel="stylesheet" href="css/font-awesomemin.css">
    <!-- Slick slider css -->
    <link rel="stylesheet" href="css/slickmin.css">
    <!-- animate css -->
    <link rel="stylesheet" href="css/animate.css">
    <!-- Nice Select css -->
    <link rel="stylesheet" href="css/nice-select.css">
    <!-- jquery UI css -->
    <link rel="stylesheet" href="css/jqueryuimin.css">
    <!-- main style css -->
    <link rel="stylesheet" href="css/style.css">

    <style type="text/css">
        .operation-botton{
            background-color: #87b106;
            color: #fdfff8;
            padding: 4px 9px;
            font-size: 15px;
            border-radius: 5px;
            cursor: pointer;
        }
        .operation-botton:hover {
            background: #282828;
        }
        table{
            table-layout: fixed;

        }
        table td{
            overflow:hidden;
            white-space:nowrap;
            text-overflow:ellipsis;
        }
    </style>

    <%--"我的"按钮判断跳转--%>
    <script>
        function wodeRedirect() {
            var jsUserType = '<%=request.getSession().getAttribute("USER_TYPE")%>';
            if(jsUserType=='<%=User.ADMIN%>')
            {
                window.location.href="/adminEntrance";
            }
            if(jsUserType=='<%=User.MAINTAINER%>')
            {
                window.location.href="/maintainerEntrance";
            }
            if(jsUserType=='<%=User.STUDENT%>'||jsUserType=='<%=User.TEACHER%>')
            {
                window.location.href="/userEntrance";
            }
        }

        function VerifyFailed(id,remark) {
            if(remark === "" || remark === null)
                alert("请在备注中填写拒绝理由！");
            else{
                window.location.href ='/VerifyFailed?RepairReportId=' + id + '&remark='+remark;
                alert("审核拒绝成功！");
            }
        };

        function VerifySuccess(id) {
            window.location.href ='/VerifySuccess?RepairReportId=' + id;
            alert("审核通过成功！");
        };
    </script>
</head>

<body>
<header class="header-area">
    <div class="main-header d-none d-lg-block">
        <!--顶部left开始-->
        <div class="header-top black-bg">
            <div class="container">
                <!--顶部选择-->
                <div class="row align-items-center">
                    <div class="col-lg-6">
                        <div class="top-left-navigation">
                            <ul class="nav align-items-center">
                            </ul>
                        </div>
                    </div>
                    <div class="col-lg-6 d-flex justify-content-end">
                        <div class="header-social-link">
                        </div>
                        <ul class="user-info-block">
                            <!--登录开始-->
                            <%if (request.getSession().getAttribute("USER_NAME")==null){%>
                            <li><a href="/login"><i class="fa fa-sign-in"></i> 登录</a></li>
                            <%}else{%>
                            <ul class="nav">
                                <!--登录开始-->
                                <li class="mini-cart-wrap">
                                    <a href="/maintainerEntrance" class="minicart-btn">
                                        <span class="fa fa-user-circle-o"></span>
                                        <% String username=(String)request.getSession().getAttribute("USER_NAME");out.print(username);%>
                                    </a>

                                    <!--两个按钮开始-->
                                    <div class="cart-list-wrapper">
                                        <div class="minicart-button">
                                            <a onclick="wodeRedirect()"><i class="fa fa-user-plus"></i> 我的</a>
                                            <a href="/logout"><i class="fa fa-user-times"></i> 注销</a>
                                        </div>
                                    </div>
                                    <!--两个按钮结束-->
                                </li>
                                <!--登录结束-->
                            </ul>
                            <%}%>
                            <!--登录结束-->
                        </ul>
                    </div>
                </div>
            </div>
        </div>

        <!--顶部left结束-->

        <div class="header-main-area black-soft sticky">
            <div class="container">
                <div class="row align-items-center position-relative">
                    <!-- logo展示开始 -->
                    <div class="col-auto">
                        <div class="logo">
                            <a href="/">
                                <img src="img/2.jpg" alt="Brand Logo">
                            </a>
                        </div>
                    </div>
                    <!-- logo展示结束 -->
                    <div class="col-auto position-static">
                        <div class="main-menu-area">
                            <div class="main-menu">
                                <!-- 标签栏开始 -->
                                <nav class="desktop-menu">
                                    <ul>
                                        <li class="active"><a href="/">主页 <i class="fa fa-angle-left"></i></a>
                                        </li>
                                    </ul>
                                </nav>
                                <!-- 标签栏结束 -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</header>

<main>
    <!-- 导航图片开始 -->
    <div class="breadcrumb-area breadcrumb-img bg-img" data-bg="img/6.jpg">
        <div class="container">
            <div class="row">
                <div class="col-12">
                    <div class="breadcrumb-wrap">
                        <nav aria-label="breadcrumb">
                            <h3 class="breadcrumb-title">高校后勤综合信息管理平台</h3>
                            <ul class="breadcrumb justify-content-center">
                                <li class="breadcrumb-item"><a href="/"><i class="fa fa-home"></i></a></li>
                                <li class="breadcrumb-item"><a href="/maintainerEntrance">维修工功能界面</a></li>
                            </ul>
                        </nav>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="blog-main-wrapper section-padding">
        <div class="container">
            <div class="row">
                <div class="myaccount-content blog-comment-wrapper" style="margin:0 auto;width: 75%">
                    <h5>未审核报修单列表</h5>
                    <div class="myaccount-table table-responsive text-center">
                        <table class="table table-bordered">
                            <%
                                List<Repairreport> UnverifiedRepairRepots = (List<Repairreport>) request.getAttribute("UnverifiedRepairRepots");
                            %>
                            <thead class="thead-light">
                                <tr>
                                    <td style="width: 100px">编号</td>
                                    <td style="width: 100px;">报修类型</td>
                                    <td style="width: 320px;">报修内容描述</td>
                                    <td style="width: 150px">报修时间</td>
                                </tr>
                            </thead>
                            <tbody>
                            <%
                                for(int i=0;i<UnverifiedRepairRepots.size();i++){
                                    Repairreport repairreport = UnverifiedRepairRepots.get(i);
                            %>
                                <tr>
                                    <td><a href="#" data-toggle="modal" data-target="#repairreport<%=repairreport.getId()%>"><%=repairreport.getId()%></a></td>
                                    <td><%=repairreport.getType()%></td>
                                    <td><%=repairreport.getRepairdesc()%></td>
                                    <td><fmt:formatDate value="<%=repairreport.getDate()%>" type="Date" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                                </tr>
                                <div class="modal fade" id="repairreport<%=repairreport.getId()%>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
                                    <div class="modal-dialog">
                                        <div class="modal-content" style="height: 600px">
                                            <form>
                                                <div class="modal-header" style="margin-top: 10px">
                                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                                    <h4 class="modal-title" id="myModalLabel">审核保修单</h4>
                                                </div>
                                                <div class="modal-body" style="text-align: left">
                                                    <div style="margin-left: 10px">
                                                        <div style="margin-top: 5px">
                                                            <div style="width: 80px;float: left">编号</div>
                                                            <div style=""><input type="text" value="<%=repairreport.getId()%>" readonly/></div>
                                                        </div>
                                                        <div style="margin-top: 5px">
                                                            <div style="width: 80px;float: left">报修人</div>
                                                            <div style=""><input type="text" value="<%=repairreport.getReportername()%>" readonly/></div>
                                                        </div>
                                                        <div style="margin-top: 5px">
                                                            <div style="width: 80px;float: left">报修人类型</div>
                                                            <div style=""><input type="text" value="<%=repairreport.getReportertype()%>" readonly/></div>
                                                        </div>
                                                        <div style="margin-top: 5px">
                                                            <div style="width: 80px;float: left">报修人电话</div>
                                                            <div style=""><input type="text" value="<%=repairreport.getTelephone()%>" readonly/></div>
                                                        </div>
                                                        <div style="margin-top: 5px">
                                                            <div style="width: 80px;float: left">宿舍区</div>
                                                            <div style=""><input type="text" value="<%=repairreport.getDormregion()%>" readonly/></div>
                                                        </div>
                                                        <div style="margin-top: 5px">
                                                            <div style="width: 80px;float: left">宿舍楼栋</div>
                                                            <div style=""><input type="text" value="<%=repairreport.getDormbuilding()%>" readonly/></div>
                                                        </div>
                                                        <div style="margin-top: 5px">
                                                            <div style="width: 80px;float: left">宿舍房号</div>
                                                            <div style=""><input type="text" value="<%=repairreport.getDormroom()%>" readonly/></div>
                                                        </div>
                                                        <div style="margin-top: 5px">
                                                            <div style="width: 80px;float: left">报修类型</div>
                                                            <div style=""><input type="text" value="<%=repairreport.getType()%>" readonly/></div>
                                                        </div>
                                                        <div style="margin-top: 5px">
                                                            <div style="width: 80px;float: left">报修描述</div>
                                                            <div style=""><textarea rows="4" cols="70" readonly><%=repairreport.getRepairdesc()%></textarea></div>
                                                        </div>
                                                        <div style="margin-top: 10px">
                                                            <div style="width: 80px;float: left">备注</div>
                                                            <div style=""><textarea id="repairremark<%=repairreport.getId()%>" rows="3" cols="70"></textarea></div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="modal-footer">
                                                    <button type="button" onclick="VerifySuccess(<%=repairreport.getId()%>)" class="operation-botton">审核通过</button>
                                                    <button type="button" onclick="VerifyFailed(<%=repairreport.getId()%>,document.getElementById('repairremark<%=repairreport.getId()%>').value)" class="operation-botton">审核不通过</button>
                                                </div>
                                            </form>
                                        </div><!-- /.modal-content -->
                                    </div><!-- /.modal -->
                                </div>
                            <%
                                }
                            %>
                            </tbody>
                        </table>
                        <div class="page text-right clearfix" style="margin-top: 40px">
                            <!-- 当前页为第一页时href="javascript:void(0)" 禁用 a 标签的点击时间事件 
                          当前页不是第一页时请求url 中返回currentPage=pageInfo.pageNum - 1  当前页 -1-->
                            <a <c:if test="${pageInfo.pageNum != pageInfo.firstPage}">href="VerifyRepairReport?currentPage=${pageInfo.pageNum - 1 }"</c:if>
                               <c:if test="${pageInfo.pageNum == pageInfo.firstPage}">href="javascript:void(0)" class="disabled"</c:if> 
                            >上一页</a>

                            <!-- foreach 从 1 开始 到 总页数结束  遍历输出 -->
                            <c:forEach begin="1" end="${pageInfo.pages }" varStatus="status">
                                <a href="VerifyRepairReport?currentPage=${status.count }"
                                   <c:if test="${status.count == pageInfo.pageNum}">class="select"</c:if>>${status.count }</a>
                            </c:forEach>
                            <!-- 当前页为最后一页时href="javascript:void(0)" 禁用 a 标签的点击时间事件 
        当前页不是最后一页时请求url 中返回currentPage=${pageInfo.pageNum - 1 } 当前页 -1-->
                            <a <c:if test="${pageInfo.pageNum == pageInfo.lastPage}">class="disabled" href="javascript:void(0)"</c:if>
                               <c:if test="${pageInfo.pageNum != pageInfo.lastPage}">href="VerifyRepairReport?currentPage=${pageInfo.pageNum + 1 }"</c:if> 
                            >下一页</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</main>

<footer class="black-bg">
    <div class="footer-middle-area">
        <div class="container">
            <div class="row mtn-30">
                <div class="col-lg-6 col-sm-12">
                    <div class="address-block mt-30">
                        <div class="footer-logo">
                            <a href="/">
                                <img src="img/2.jpg" alt="Brand Logo">
                            </a>
                        </div>
                        <address class="address-info d-flex align-items-center">
                            <i class="fa fa-map-marker"></i>
                            <p><span>ADDRESS : </span> 梦翔大厦</p>
                        </address>
                    </div>
                </div>
                <div class="col-lg-3 col-sm-6">
                    <address class="address-info email mt-30">
                        <i class="fa fa-envelope"></i>
                        <p><span>EMAIL : </span><a href="#">xxxx@qq.com</a></p>
                    </address>
                </div>
                <div class="col-lg-3 col-sm-6">
                    <address class="address-info email mt-30">
                        <i class="fa fa-phone"></i>
                        <p><span>PHONE : </span><a href="#">158xxxxx9442</a></p>
                    </address>
                </div>
            </div>
        </div>
    </div>
    <div class="footer-bottom-area text-center">
        <div class="container">
            <div class="row">
                <div class="col-12">
                    <div class="payment-method-list">

                    </div>

                    <p class="copyright">
                        Copyright © www.xxx.com
                    </p>
                </div>
            </div>
        </div>
    </div>
</footer>

<!-- JS
============================================ -->

<!-- Modernizer JS -->
<script src="js/modernizr-3.6.0min.js"></script>
<!-- jQuery JS -->
<script src="js/jquery-3.3.1min.js"></script>
<!-- Popper JS -->
<script src="js/poppermin.js"></script>
<!-- Bootstrap JS -->
<script src="js/bootstrapmin.js"></script>
<!-- slick Slider JS -->
<script src="js/slickmin.js"></script>
<!-- Countdown JS -->
<script src="js/countdownmin.js"></script>
<!-- Nice Select JS -->
<script src="js/nice-selectmin.js"></script>
<!-- jquery UI JS -->
<script src="js/jqueryuimin.js"></script>
<!-- Image zoom JS -->
<script src="js/image-zoommin.js"></script>
<!-- image loaded js -->
<script src="js/imagesloadedpkgdmin.js"></script>
<!-- masonry  -->
<script src="js/masonrypkgdmin.js"></script>
<!-- mailchimp active js -->
<script src="js/ajaxchimp.js"></script>
<!-- contact form dynamic js -->
<script src="js/ajax-mail.js"></script>
<!-- google map api -->
<script src="http://ditu.google.cn/maps/api/js?key=AIzaSyCfmCVTjRI007pC1Yk2o2d_EhgkjTsFVN8"></script>
<!-- google map active js -->
<script src="js/google-map.js"></script>
<!-- Main JS -->
<script src="js/main.js"></script>

<script src="js/jquery.js"></script>
</body>
</html>
